package com.pipi.sso.dao.manager.impl;

import com.pipi.sso.dao.support.PageResult;
import com.pipi.sso.dao.model.DormitoryAssetsDO;
import com.pipi.sso.dao.query.DormitoryAssetsQuery;
import com.pipi.sso.dao.mapper.ext.DormitoryAssetsExtMapper;
import com.pipi.sso.dao.manager.DormitoryAssetsManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for DormitoryAssets.
 */

@Component
public class DormitoryAssetsManagerImpl implements DormitoryAssetsManager{

    
    @Autowired
    protected DormitoryAssetsExtMapper dormitoryAssetsExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(DormitoryAssetsQuery query){
        return dormitoryAssetsExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(DormitoryAssetsQuery query){
        return dormitoryAssetsExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(DormitoryAssetsDO record){
        return dormitoryAssetsExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(DormitoryAssetsDO record){
        return dormitoryAssetsExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<DormitoryAssetsDO> selectByQuery(DormitoryAssetsQuery query){
        return dormitoryAssetsExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<DormitoryAssetsDO> selectByQueryWithPage(DormitoryAssetsQuery query) {
        PageResult<DormitoryAssetsDO> result = new PageResult<DormitoryAssetsDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public DormitoryAssetsDO selectByPrimaryKey(Long id){
        return dormitoryAssetsExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( DormitoryAssetsDO record,  DormitoryAssetsQuery query){
        return dormitoryAssetsExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( DormitoryAssetsDO record,  DormitoryAssetsQuery query){

        return dormitoryAssetsExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(DormitoryAssetsDO record){
        return dormitoryAssetsExtMapper.updateByPrimaryKeySelective(record);
    }
}